package com.flyou.ccnucenter.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;


import com.flyou.ccnucenter.R;
import com.flyou.photopicker.model.PhotoInfo;


import java.util.List;

/**
 * ============================================================
 * 项目名称：ChildDevelopmentAssistant
 * 包名称：com.e1858.childassistant.adapter
 * 文件名：LostFoundPsotPhotoAdapter
 * 类描述：
 * 创建人：flyou
 * 邮箱：fangjaylong@gmail.com
 * 创建时间：2015/12/11 12:59
 * 修改备注：
 * 版本：@version  V1.0
 * ============================================================
 */
public class LostFoundPsotPhotoAdapter extends SimpleBaseAdapter {
    private  List<PhotoInfo>data1;

    public LostFoundPsotPhotoAdapter(Context context, List<PhotoInfo> data) {
        super(context, data);
        this.data1=data;
    }

    @Override
    public int getItemResource() {
        return R.layout.view_bbs_photo_gridview_item;
    }

    @Override
    public View getItemView(int position, View convertView, ViewHolder holder) {
        PhotoInfo photoInfo;
        Object item = getItem(position);
        photoInfo=(PhotoInfo)item;
        ImageView imageView = (ImageView) holder.getView(R.id.imageView);

        if (TextUtils.isEmpty(photoInfo.getThumbPath())) {
          imageView.setImageResource(R.drawable.bbs_icon_add);

        }else {
            com.nostra13.universalimageloader.core.ImageLoader.getInstance().displayImage("file:/" + photoInfo.getPhotoPath(), imageView);
        }
        return convertView;
    }
}
